#!/usr/bin/env python3
# -*- coding=utf-8 -*-
# 题目：古典问题：有一对兔子，
# 从出生后第3个月起每个月都生一对兔子，
# 小兔子长到第三个月后每个月又生一对兔子，
# 假如兔子都不死，问每个月的兔子总数为多少？
class RABBIT:
    rabbit_list = []

    def __init__(self):
        RABBIT.rabbit_list.append(1)

    def growup(self):
        for x in range(len(self.rabbit_list)):
            if self.rabbit_list[x] > 2:
                self.rabbit_list.append(1)
            else:
                self.rabbit_list[x] += 1


def f1(n):
    rabbit_list = [0]
    for x in range(n):
        length = len(rabbit_list)
        for y in range(length):
            if rabbit_list[y] == 2:
                rabbit_list.append(1)
            else:
                rabbit_list[y] += 1

        print(x, ": ", rabbit_list)


def f2():
    f1(10)


f = f2
if __name__ == "__main__":
    f1(10)
